<template>
  <div class="left-chart-1">
    <div class="lc1-header">PM2.5实时变化趋势</div>
    <!-- <dv-capsule-chart class="lc1-chart" :config="config" /> -->
    <dv-charts class="lc1-chart" :option="option" />
    <dv-decoration-2 style="height:10px;" />
  </div>
</template>

<script>
export default {
  name: 'LeftChart1',
  data () {
    return {
      option: {
        // legend: {
        //   data: ['PM2.5'],
        //   top: '6px',
        //   textStyle: {
        //     fill: '#fff'
        //   }
        // },
        grid: {
          top: '14%',
          left: '10%',
          right: '6%',
          bottom: '14%'
        },
        xAxis: {
          data: [
            '06', '07', '08', '09', '10', '11',
            '12', '13', '14', '15', '16', '17',
            '18', '19', '20', '21', '22'
          ],
          boundaryGap: false,
          axisLine: {
            style: {
              stroke: '#999'
            }
          },
          axisLabel: {
            style: {
              fill: '#999'
            }
          },
          axisTick: {
            show: false
          }
        },
        yAxis: {
          name: 'ug/m3',
          nameTextStyle: {
            fill: '#999',
            fontSize: 10
          },
          data: 'value',
          splitLine: {
            show: false
          },
          axisLine: {
            style: {
              stroke: '#999'
            }
          },
          min: 0,
          axisLabel: {
            style: {
              fill: '#999'
            },
            formatter ({ value }) {
              return value.toFixed(0)
            }
          },
          axisTick: {
            show: false
          }
          // min: 95,
          // max: 100,
          // interval: 1
        },
        series: [
          {
            data: [
              0, 0, 0, 0, 0, 0,
              0, 0, 0, 0, 0, 0,
              0, 0, 0, 65
            ],
            type: 'line',
            name: 'PM2.5',
            // smooth: true,
            lineArea: {
              show: true,
              gradient: ['rgba(55, 162, 218, 0.6)', 'rgba(55, 162, 218, 0)']
            },
            linePoint: {
              radius: 4,
              style: {
                fill: '#00db95'
              }
            }
          }
        ]
      }
    }
  }
}
</script>

<style lang="less">
.left-chart-1 {
  width: 100%;
  height: 33%;
  display: flex;
  flex-grow: 0;
  flex-direction: column;

  .lc1-header {
    text-align: center;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    margin-bottom: 4px;
    margin-top: 10px;
  }

  .lc1-details {
    height: 50px;
    font-size: 16px;
    display: flex;
    align-items: center;
    text-indent: 20px;

    span {
      color: #096dd9;
      font-weight: bold;
      font-size: 35px;
      margin-left: 20px;
    }
  }

  .lc1-chart {
    flex: 1;
  }
}
</style>
